﻿Imports PackageIO
Public Class Form4
    Dim FilePath As String
    Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
        Try

            Dim Open As New OpenFileDialog
            Open.Title = "Open A Paintball 2009 Gamesave"
            Open.ShowDialog()
            FilePath = Open.FileName
            ReadFile()
        Catch ex As Exception
        End Try
    End Sub

    Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
        Dim Writer As New PackageIO.Writer(FilePath, PackageIO.Endian.Big)
        Writer.Position = &HD980
        Writer.WriteInt32(TextBox2.Text)
        MsgBox("File Successfully Modded!", MsgBoxStyle.Information)
    End Sub
    Private Sub ReadFile()
        Dim Reader As New PackageIO.Reader(FilePath, PackageIO.Endian.Big)
        Reader.Position = &HD980
        TextBox1.Text = Reader.ReadInt32
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked = True Then
            TextBox2.Text = "5000"
        ElseIf CheckBox1.Checked = False Then
            TextBox2.Text = ""
        End If
    End Sub

    Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class